package com.wdl.sm.webui.yang.node;

import java.util.ArrayList;
import java.util.List;

import com.nokia.taiji.yang.schema.SchemaNode;
import com.nokia.taiji.yang.schema.YANG_Container;
import com.wdl.sm.webui.yang.YANGExt;

public class ContainerNode extends NormalizedNode {
    List<Object> elements = new ArrayList<Object>();

    public ContainerNode(YANG_Container node) {
        super(node);

        List<SchemaNode> children = node.getChildren();
        if (children == null || children.isEmpty()) {
            return;
        }

        for (SchemaNode child : children) {
            Object element = YANGExt.buildWebuiYangNode(child);
            // element could be NormalizedNode or ChoiceNode
            if (element != null) {
                elements.add(element);
            }
        }
    }

    public List<Object> getElements() {
        return elements;
    }
}